<?php

namespace app\models\dao;

use Yii;

/**
 * This is the model class for table "{{%role_access}}".
 *
 * @property integer $role_id
 * @property integer $node_id
 */
class RoleAccess extends \app\common\PopToolActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%role_access}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['role_id', 'node_id'], 'required'],
            [['role_id', 'node_id'], 'integer'],
            [['role_id', 'node_id'], 'unique', 'targetAttribute' => ['role_id', 'node_id'], 'message' => 'The combination of 节点id and 角色id has already been taken.'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'role_id' => '节点id',
            'node_id' => '角色id',
        ];
    }
}
